﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace proyecto
{
    /// <summary>
    /// Lógica de interacción para selectTable.xaml
    /// </summary>
    public partial class selectTable : Window
    {

        bool ok;

        public selectTable(data matrix)
        {
            InitializeComponent();
            ok = false;

            for (int i = 0; i < 20; i++)
            {
                if (matrix.isCreated(i))
                    comboBox1.Items.Add(matrix.getTable(i).TableName);
            }

            comboBox1.SelectedIndex = 0;

        }

        public bool result()
        {
            return ok;
        }

        public string tableName()
        {
            return (comboBox1.SelectedItem as string);
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            ok = true;
            this.Close();
        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }

    
}
